using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
	
    public class LIST_LOOKUPInfo
    {
		#region Local Variable
		public enum Field
		{
			DTB,
			LOOKUP_CATEGORY,
			CODE,
			LOOKUP_ALT,
			DESCRIPTN,
			DESCRIPTN1,
			STATUS,
			CREATEDBY,
			MODIFIEDBY,
			CREATEDDATE,
			MODIFIEDDATE
		}
		private String _DTB;
		private String _LOOKUP_CATEGORY;
		private String _CODE;
		private String _LOOKUP_ALT;
		private String _DESCRIPTN;
		private String _DESCRIPTN1;
		private String _STATUS;
		private String _CREATEDBY;
		private String _MODIFIEDBY;
		private Int32 _CREATEDDATE;
		private Int32 _MODIFIEDDATE;
		
		public String DTB{	get{ return _DTB;} set{_DTB = value;} }
		public String LOOKUP_CATEGORY{	get{ return _LOOKUP_CATEGORY;} set{_LOOKUP_CATEGORY = value;} }
		public String CODE{	get{ return _CODE;} set{_CODE = value;} }
		public String LOOKUP_ALT{	get{ return _LOOKUP_ALT;} set{_LOOKUP_ALT = value;} }
		public String DESCRIPTN{	get{ return _DESCRIPTN;} set{_DESCRIPTN = value;} }
		public String DESCRIPTN1{	get{ return _DESCRIPTN1;} set{_DESCRIPTN1 = value;} }
		public String STATUS{	get{ return _STATUS;} set{_STATUS = value;} }
		public String CREATEDBY{	get{ return _CREATEDBY;} set{_CREATEDBY = value;} }
		public String MODIFIEDBY{	get{ return _MODIFIEDBY;} set{_MODIFIEDBY = value;} }
		public Int32 CREATEDDATE{	get{ return _CREATEDDATE;} set{_CREATEDDATE = value;} }
		public Int32 MODIFIEDDATE{	get{ return _MODIFIEDDATE;} set{_MODIFIEDDATE = value;} }
		
        #endregion LocalVariable
        
        #region Constructor
		public LIST_LOOKUPInfo()
		{
			_DTB = "";
			_LOOKUP_CATEGORY = "";
			_CODE = "";
			_LOOKUP_ALT = "";
			_DESCRIPTN = "";
			_DESCRIPTN1 = "";
			_STATUS = "";
			_CREATEDBY = "";
			_MODIFIEDBY = "";
			_CREATEDDATE = 0;
			_MODIFIEDDATE = 0;
		}
		public LIST_LOOKUPInfo(
		String DTB,
		String LOOKUP_CATEGORY,
		String CODE,
		String LOOKUP_ALT,
		String DESCRIPTN,
		String DESCRIPTN1,
		String STATUS,
		String CREATEDBY,
		String MODIFIEDBY,
		Int32 CREATEDDATE,
		Int32 MODIFIEDDATE
		)
		{
			_DTB = DTB;
			_LOOKUP_CATEGORY = LOOKUP_CATEGORY;
			_CODE = CODE;
			_LOOKUP_ALT = LOOKUP_ALT;
			_DESCRIPTN = DESCRIPTN;
			_DESCRIPTN1 = DESCRIPTN1;
			_STATUS = STATUS;
			_CREATEDBY = CREATEDBY;
			_MODIFIEDBY = MODIFIEDBY;
			_CREATEDDATE = CREATEDDATE;
			_MODIFIEDDATE = MODIFIEDDATE;
		}
		public LIST_LOOKUPInfo(DataRow dr)
		{
			if (dr != null)
			{
				_DTB = dr[Field.DTB.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DTB.ToString()]);
				_LOOKUP_CATEGORY = dr[Field.LOOKUP_CATEGORY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOOKUP_CATEGORY.ToString()]);
				_CODE = dr[Field.CODE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CODE.ToString()]);
				_LOOKUP_ALT = dr[Field.LOOKUP_ALT.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOOKUP_ALT.ToString()]);
				_DESCRIPTN = dr[Field.DESCRIPTN.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DESCRIPTN.ToString()]);
				_DESCRIPTN1 = dr[Field.DESCRIPTN1.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DESCRIPTN1.ToString()]);
				_STATUS = dr[Field.STATUS.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.STATUS.ToString()]);
				_CREATEDBY = dr[Field.CREATEDBY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CREATEDBY.ToString()]);
				_MODIFIEDBY = dr[Field.MODIFIEDBY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.MODIFIEDBY.ToString()]);
				_CREATEDDATE = dr[Field.CREATEDDATE.ToString()] == DBNull.Value?0:Convert.ToInt32(dr[Field.CREATEDDATE.ToString()]);
				_MODIFIEDDATE = dr[Field.MODIFIEDDATE.ToString()] == DBNull.Value?0:Convert.ToInt32(dr[Field.MODIFIEDDATE.ToString()]);
			}
		}
		public LIST_LOOKUPInfo(LIST_LOOKUPInfo objEntr)
		{			
			_DTB = objEntr.DTB;			
			_LOOKUP_CATEGORY = objEntr.LOOKUP_CATEGORY;			
			_CODE = objEntr.CODE;			
			_LOOKUP_ALT = objEntr.LOOKUP_ALT;			
			_DESCRIPTN = objEntr.DESCRIPTN;			
			_DESCRIPTN1 = objEntr.DESCRIPTN1;			
			_STATUS = objEntr.STATUS;			
			_CREATEDBY = objEntr.CREATEDBY;			
			_MODIFIEDBY = objEntr.MODIFIEDBY;			
			_CREATEDDATE = objEntr.CREATEDDATE;			
			_MODIFIEDDATE = objEntr.MODIFIEDDATE;			
		}
        #endregion Constructor
        
        #region InitTable
		public DataTable ToDataTable()
		{
			DataTable dt = new DataTable("MMS_LOOKUP");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn(Field.DTB.ToString(), typeof(String)),
				new DataColumn(Field.LOOKUP_CATEGORY.ToString(), typeof(String)),
				new DataColumn(Field.CODE.ToString(), typeof(String)),
				new DataColumn(Field.LOOKUP_ALT.ToString(), typeof(String)),
				new DataColumn(Field.DESCRIPTN.ToString(), typeof(String)),
				new DataColumn(Field.DESCRIPTN1.ToString(), typeof(String)),
				new DataColumn(Field.STATUS.ToString(), typeof(String)),
				new DataColumn(Field.CREATEDBY.ToString(), typeof(String)),
				new DataColumn(Field.MODIFIEDBY.ToString(), typeof(String)),
				new DataColumn(Field.CREATEDDATE.ToString(), typeof(Int32)),
				new DataColumn(Field.MODIFIEDDATE.ToString(), typeof(Int32))
			});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row[Field.DTB.ToString()] = _DTB;
			row[Field.LOOKUP_CATEGORY.ToString()] = _LOOKUP_CATEGORY;
			row[Field.CODE.ToString()] = _CODE;
			row[Field.LOOKUP_ALT.ToString()] = _LOOKUP_ALT;
			row[Field.DESCRIPTN.ToString()] = _DESCRIPTN;
			row[Field.DESCRIPTN1.ToString()] = _DESCRIPTN1;
			row[Field.STATUS.ToString()] = _STATUS;
			row[Field.CREATEDBY.ToString()] = _CREATEDBY;
			row[Field.MODIFIEDBY.ToString()] = _MODIFIEDBY;
			row[Field.CREATEDDATE.ToString()] = _CREATEDDATE;
			row[Field.MODIFIEDDATE.ToString()] = _MODIFIEDDATE;
			return row;
		}
        #endregion InitTable
    }
}
